Skip to content

Add game tests for IntegratedTerminals advancements; bump ID/CyclopsCore versions#192

Merged
rubensworks merged 5 commits intomaster-1.21-ltsfrom
copilot/add-game-tests-for-advancements
Feb 28, 2026
Merged

Add game tests for IntegratedTerminals advancements; bump ID/CyclopsCore versions#192
rubensworks merged 5 commits intomaster-1.21-ltsfrom
copilot/add-game-tests-for-advancements

Conversation

Copy link
Contributor

Copilot AI commented Feb 28, 2026

Adds game tests covering all five IntegratedTerminals advancements and fixes the game test infrastructure so they actually run and pass. Dependency versions are bumped to pick up upstream game test fixes.

Dependency bumps

  • cyclopscore_version: 1.25.1-6271.26.2-808 (fixes game test server infrastructure)
  • integrateddynamics_version: 1.30.3-14691.32.0-1630

Game tests added (GameTestAdvancementsIntegratedTerminals)

Test Advancement Trigger mechanism
testAdvancementRoot root inventoryMenu.broadcastChanges() with part_display_panel in slot 0
testAdvancementMenrilGlass storage_terminal/menril_glass inventoryMenu.broadcastChanges() with menril_glass in slot 0
testAdvancementCraftStorageTerminal storage_terminal/craft_storage_terminal Fire PlayerEvent.ItemCraftedEvent directly
testAdvancementGuiStorageTerminal storage_terminal/gui_storage_terminal Fire PlayerContainerEvent.Open directly
testAdvancementFilterEnchantable storage_terminal_filtering/filter_enchantable Call container.onVariableContentsUpdated() with a mock IVariable

Key workarounds for the embedded game-test channel

The game test environment uses an embedded Netty channel with no NeoForge custom channel negotiation, so two packet-send failures had to be handled:

integrateddynamics:all_labels on player loginplaceNewPlayer completes all advancement-relevant setup before the failing event fires, so the exception is caught and swallowed:

try {
    helper.getLevel().getServer().getPlayerList().placeNewPlayer(connection, player, cookie);
} catch (Exception ignored) { }

cyclopscore:value_notify from ContainerExtended.setValue — thrown both during ContainerTerminalStoragePart construction and during onVariableContentsUpdated. Suppressed via an anonymous subclass (virtual dispatch ensures the override fires even from the superclass constructor):

private static ContainerTerminalStoragePart createSilentContainer(...) {
    return new ContainerTerminalStoragePart(...) {
        @Override
        public void setValue(int valueId, CompoundTag value) {
            // suppress value_notify sends; no channel negotiation in game tests
        }
    };
}

InventoryVariableEvaluator returning null — in testAdvancementFilterEnchantable, the evaluator can't resolve the variable because the item isn't registered in the network's variable store. Rather than fighting the evaluator, onVariableContentsUpdated is called directly with a minimal IVariable stub that returns the expected operator value:

IVariable<ValueTypeOperator.ValueOperator> mockVariable = new IVariable<>() {
    @Override public IValueType<ValueTypeOperator.ValueOperator> getType() { return ValueTypes.OPERATOR; }
    @Override public ValueTypeOperator.ValueOperator getValue() { return ValueTypeOperator.ValueOperator.of(Operators.OBJECT_ITEMSTACK_ISENCHANTABLE); }
    @Override public void addInvalidationListener(IVariableInvalidateListener l) {}
    @Override public void removeInvalidationListener(IVariableInvalidateListener l) {}
    @Override public void invalidate() {}
};
container.onVariableContentsUpdated(network, mockVariable);

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
Copilot AI changed the title [WIP] Add game tests for all advancements in the mod Add game tests for all mod advancements Feb 28, 2026
…fix gui_storage_terminal test

Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
Copilot AI changed the title Add game tests for all mod advancements Add game tests for all IntegratedTerminals advancements Feb 28, 2026
….0-1630

Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
Copilot AI changed the title Add game tests for all IntegratedTerminals advancements Add game tests for IntegratedTerminals advancements; bump ID/CyclopsCore versions Feb 28, 2026
@rubensworks rubensworks marked this pull request as ready for review February 28, 2026 16:10
@rubensworks rubensworks merged commit 1d3efc5 into master-1.21-lts Feb 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants